package com.greystripe.sdk;

import android.webkit.JavascriptInterface;

final class as
{
  private GSFullscreenActivity a;
  private int b = -1;
  private boolean c = false;
  private boolean d = false;

  final void a()
  {
    this.a = null;
    this.b = -1;
    this.c = false;
    this.d = false;
  }

  final void a(GSFullscreenActivity paramGSFullscreenActivity)
  {
    bd.b("setActivity()", new Object[0]);
    this.a = paramGSFullscreenActivity;
    if (this.c)
      lockOrientation();
    while (true)
    {
      GSFullscreenAd.c.j().b("EventHandler.broadcastEvent('orientationchange', " + getOrientation() + ");");
      return;
      this.a.setRequestedOrientation(2);
    }
  }

  @JavascriptInterface
  public final void close()
  {
    bd.b("FullscreenAdController#close", new Object[0]);
    if (this.a != null)
    {
      bd.b("Finishing the Activity", new Object[0]);
      this.a.finish();
    }
  }

  @JavascriptInterface
  public final int getOrientation()
  {
    int i = 2;
    if (this.a != null)
    {
      int j;
      if (this.b != -1)
        switch (this.b)
        {
        default:
          j = 0;
          switch (j)
          {
          default:
            bd.c("Java: Unknown orientation: " + j, new Object[0]);
            i = 0;
          case 1:
          case 3:
          case 0:
          case 2:
          }
          break;
        case 0:
        case 1:
        }
      while (true)
      {
        bd.b("Java: getOrientation(" + j + ") returned: " + i, new Object[0]);
        return i;
        j = i;
        break;
        j = 1;
        break;
        j = this.a.a();
        break;
        i = 0;
        continue;
        i = 1;
      }
    }
    return 0;
  }

  @JavascriptInterface
  public final void lockOrientation()
  {
    this.c = true;
    if ((this.a != null) && (!this.d))
    {
      this.d = true;
      if (this.b != -1)
        this.a.a(this.b);
    }
    else
    {
      return;
    }
    this.a.b();
  }

  @JavascriptInterface
  public final void setOrientation(int paramInt)
  {
    bd.b("fscontroller#setOrientation(" + paramInt + ")", new Object[0]);
    int i = 0;
    if (paramInt == 1);
    while (this.a == null)
    {
      this.b = i;
      this.c = true;
      return;
      i = 1;
    }
    this.a.a(i);
  }

  @JavascriptInterface
  public final void takeScreenshot()
  {
    if (this.a != null)
      this.a.takeScreenshot();
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.greystripe.sdk.as
 * JD-Core Version:    0.6.2
 */